home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-11 | 5.1 KB | 298 lines | [TEXT/MPS ] |
- ;
- ; File: Threads.a
- ;
- ; Copyright: © 1984-1994 by Apple Computer, Inc.
- ; All rights reserved.
- ;
- ; Version: Universal Interfaces 2.0a3 ETO #16, MPW prerelease. Friday, November 11, 1994.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
-
- IF &TYPE('__THREADS__') = 'UNDEFINED' THEN
- __THREADS__ SET 1
-
-
- IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
- include 'Errors.a'
- ENDIF
- ; include 'ConditionalMacros.a' ;
-
- IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
- include 'Memory.a'
- ENDIF
- ; include 'Types.a' ;
- ; include 'MixedMode.a' ;
-
- kReadyThreadState EQU 0
- kStoppedThreadState EQU 1
- kRunningThreadState EQU 2
-
- ; Error codes have been meoved to Errors.(pah)
- ; Thread environment characteristics
- ; Thread characteristics
- kCooperativeThread EQU 1 << 0
- kPreemptiveThread EQU 1 << 1
-
- ; Thread identifiers
- kNoThreadID EQU 0
- kCurrentThreadID EQU 1
- kApplicationThreadID EQU 2
-
- ; Options when creating a thread
- kNewSuspend EQU (1 << 0)
- kUsePremadeThread EQU (1 << 1)
- kCreateIfNeeded EQU (1 << 2)
- kFPUNotNeeded EQU (1 << 3)
- kExactMatchThread EQU (1 << 4)
-
- ; Information supplied to the custom scheduler
- SchedulerInfoRec RECORD 0
- InfoRecSize ds.l 1
- CurrentThreadID ds.l 1
- SuggestedThreadID ds.l 1
- InterruptedCoopThreadID ds.l 1
- sizeof EQU 16
- ENDR
-
- ;
- ; The following ProcPtrs cannot be interchanged with UniversalProcPtrs because
- ; of differences between 680x0 and PowerPC runtime architectures with regard to
- ; the implementation of the Thread Manager.
- ;
- ; Prototype for thread's entry (main) routine
- ; Prototype for custom thread scheduler routine
- ; Prototype for custom thread switcher routine
- ; Prototype for thread termination notification routine
- ; Prototype for debugger NewThread notification
- ; Prototype for debugger DisposeThread notification
- ; Prototype for debugger schedule notification
- ; Thread Manager routines
- IF GENERATING68K THEN
- Macro
- _CreateThreadPool
- move.w #$0501,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT CreateThreadPool
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _GetFreeThreadCount
- move.w #$0402,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT GetFreeThreadCount
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _GetSpecificFreeThreadCount
- move.w #$0615,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT GetSpecificFreeThreadCount
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _GetDefaultThreadStackSize
- move.w #$0413,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT GetDefaultThreadStackSize
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _ThreadCurrentStackSpace
- move.w #$0414,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT ThreadCurrentStackSpace
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _NewThread
- move.w #$0E03,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT NewThread
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _DisposeThread
- move.w #$0504,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT DisposeThread
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _YieldToThread
- move.w #$0205,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT YieldToThread
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _YieldToAnyThread
- dc.w $42A7
- move.w #$0205,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT YieldToAnyThread
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _GetCurrentThread
- move.w #$0206,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT GetCurrentThread
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _GetThreadState
- move.w #$0407,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT GetThreadState
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SetThreadState
- move.w #$0508,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT SetThreadState
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SetThreadStateEndCritical
- move.w #$0512,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT SetThreadStateEndCritical
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SetThreadScheduler
- move.w #$0209,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT SetThreadScheduler
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SetThreadSwitcher
- move.w #$070A,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT SetThreadSwitcher
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SetThreadTerminator
- move.w #$0611,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT SetThreadTerminator
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _ThreadBeginCritical
- move.w #$000B,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT ThreadBeginCritical
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _ThreadEndCritical
- move.w #$000C,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT ThreadEndCritical
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SetDebuggerNotificationProcs
- move.w #$060D,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT SetDebuggerNotificationProcs
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _GetThreadCurrentTaskRef
- move.w #$020E,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT GetThreadCurrentTaskRef
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _GetThreadStateGivenTaskRef
- move.w #$060F,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT GetThreadStateGivenTaskRef
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SetThreadReadyGivenTaskRef
- move.w #$0410,d0
- dc.w $ABF2
- EndM
- ELSE
- IMPORT SetThreadReadyGivenTaskRef
- ENDIF
-
- ENDIF ; __THREADS__
-